﻿using LitJson;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VIPData
{

    /// <summary>
    /// 状态码
    /// </summary>
    public int Code;
    /// <summary>
    /// 提示消息
    /// </summary>
    public string Msg;
    /// <summary>
    /// 数据
    /// </summary>
    public JsonData Data;

    /// <summary>
    /// string转VIPData
    /// </summary>
    /// <param name="text"></param>
    /// <returns></returns>
    public static VIPData ToVIPData(string text) {
        JsonData jsonData = JsonMapper.ToObject(text);
        int code = int.Parse(jsonData["code"].ToString());
        string msg = jsonData["msg"].ToString();
        JsonData data = jsonData["data"];
        VIPData vipData = new VIPData
        {
            Code = code,
            Msg = msg,
            Data = data
        };
        return vipData;
    }

}
